<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style.css">
    <script src="js/jquery-1.10.2.min.js"></script>
</head>
<body>
<!--main-header start-->
<div class="main-header">
    <div class="w-1200 clearfix">
        <div class="header-logo fl"><a href=""><img src="images/logo.png"></a> </div>
        <!--header-person start-->
        <div id="head_login"></div>
        <script type="text/javascript">
          
          $("#head_login").load("login_common.html");
        </script>
        <!--header-person end-->
        <!--header-nav start-->
        <div class="header-nav fr">
            <ul class="nav">
                <li><a href="/exptindex.html">待审核项目</a> </li>
                <li><a href="/exptindex2.html">已审核项目</a> </li>
                <span id="art"></span>
                <script>$("#art").load("artcommon.html")</script>
            </ul>
        </div>
        <!--header-nav end-->
    </div>
</div>
<!--main-header end-->
<!--scan-container start-->
<div class="scan-container w-1200" id="mainbox">
    <!--scan-step start-->
    <div class="scan-step clearfix">
        <div class="scan-step-hd fl">项目进度</div>
        <div class="scan-step-bd">
            <div class="step-num">
                <span class="circle">1</span>
                <p>资料准备</p>
            </div>
            <div class="step-num">
                <span class="circle">2</span>
                <p>预审中</p>
            </div>
            <div class="step-num">
                <span class="circle">3</span>
                <p>评审中</p>
            </div>
            <div class="step-num">
                <span class="circle">4</span>
                <p>复核中</p>
            </div>
            <div class="step-num">
                <span class="circle">5</span>
                <p>定审中</p>
            </div>
            <div class="step-num">
                <span class="circle">6</span>
                <p>完结</p>
            </div>
        </div>
    </div>
    <!--scan-step end-->
    <!--scan-main start-->
    <div class="scan-main" id="boxidea">
        <!--scan-box start-->
        <div class="scan-box">
            <div class="scan-box-tit">项目基本信息</div>
            <div class="scan-box-con">
                <div class="scan-box-li">
                    <span class="label">项目标段：</span>
                    <span class="name" id="xmbd">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">项目联系人：</span>
                    <span class="name" id="xmlxr">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">项目地址：</span>
                    <span class="name" id="address">1234456</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">项目名称：</span>
                    <span class="name" id="name">mumu-li</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">评审类别：</span>
                    <span class="name" id="type">建筑施工</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">所属业主：</span>
                    <span class="name" id="owner">mumu-li</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">行业分类：</span>
                    <span class="name" id="industry">mumu-li</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">立项文号：</span>
                    <span class="name" id="lxwh">1234456</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">技术评审人意见编号：</span>
                    <span class="name" id="yjbh">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">项目介绍：</span>
                    <span class="name" id="description">000001111111</span>
                </div>
            </div>
        </div>
        <!--scan-box end-->
        <!--scan-box start-->
        <div class="scan-box">
            <div class="scan-box-tit">委托机构信息</div>
            <div class="scan-box-con">
                <div class="scan-box-li">
                    <span class="label">委托单位：</span>
                    <span class="name" id='wtdw'>000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">委托单位联系人：</span>
                    <span class="name" id='wtdwlxr'>000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">委托单位联系人电话：</span>
                    <span class="name" id='wtdwlxrdh'>000001111111</span>
                </div>
            </div>
        </div>
        <!--scan-box end-->
        <!--scan-box start-->
        <div class="scan-box">
            <div class="scan-box-tit">立项信息</div>
            <div class="scan-box-con">
                <div class="scan-box-li">
                    <span class="label">编制机构：</span>
                    <span class="name" id='bzjg'>000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">编制人：</span>
                    <span class="name" id='bzr'>000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">定价依据：</span>
                    <span class="name">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">定额体系：</span>
                    <span class="name">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">立项金额：</span>
                    <span class="name" id='cash'>000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">送审投资金额：</span>
                    <span class="name">000001111111</span>
                </div>
                <div class="scan-box-li">
                    <span class="label">立项时间：</span>
                    <span class="name">2021-10-22</span>
                </div>
            </div>
        </div>
        <!--scan-box end-->
        <!--scan-box start-->
        <div class="scan-box" id="filebox">
            <script>
                $("#filebox").load("filedetail.html");
            </script>
        </div>
        <!--scan-box end-->










    </div>
</div>
<!--scan-container end-->


<script src="js/auth.js"></script>

<script type="text/javascript">
    
    var id=getQueryString("id");
    console.log(id);
    $.get(HTTP_HOST+"api/jg/detail?id="+id,function(res){
            if (res.code == 200) {
                item = res.result.item;
    
                    $("#xmbd").html(item.xmbd);
                    $("#xmlxr").html(item.contactor);
                    $("#address").html(item.address);
                    $("#name").html(item.name);
                    $("#type").html(item.type);
                    $("#owner").html(item.owner);
                    $("#industry").html(item.industry);
    
                    $("#lxwh").html(item.lxnumber);
                    $("#yjbh").html(item.yjbh);
    
                    $("#wtdw").html(item.wtdw);
                    $("#wtdwlxr").html(item.wtdwcontactor);
                    $("#wtdwlxrdh").html(item.wtdwcontactorphone);
                    $("#cash").html(item.cash);
    

                    var index = getstat(item.status);
                    $(".step-num").each(function(k,obj){
                        if(k<=index){
                            $(obj).addClass("on");
                        }  
                    });


                    if(item.status==3){
                        var act=` <div class="scan-box">
            <div class="scan-box-tit">审核意见</div>
            <div class="scan-opinion-text">
                <div class="text-bor">
                    <textarea rows="5" id="idea" placeholder="在此输入你对此次项目的具体评审意见"></textarea>
                </div>
            </div>
        </div>
        <!--scan-box end-->





        <!--add-item start-->
        <div class="add-item">
            <div class="con w-full">
                <div class="input-w" style="width:1140px; margin: 0; ">
                    <div class="add-item-flex">
                        <div class="add-item-up">
                            <input type="file" multiple="multiple" class="add-item-up-file"   name="file[]" id="fileapprove" />
                            <span><img src="images/add2.png" ></span>
                        </div>
                        <div class="add-item-tip">
                            <p>1、可上传附件.</p>
                            <p>2、支持压缩包格式：rar、zip。</p>
                            <p>3、支持图片格式：jpeg、jpg、bmp、png。</p>
                            <p>4、支持办公文件格式：doc、docx、xls、xlsx、pdf、ppt。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--add-item end-->
        <!--add-item-files start-->
        <div class="add-item-files" style="width:1100px; margin: 0; "  id="boxfiles">
          
        </div>
        <!--add-item-files end-->

    </div>
    <!--scan-main end-->








        <!--add-bottom start-->
        <div class="add-bottom mar0">
            <button class="login-btn" onClick="goidea()">提交</button>
        </div>`;


    $("#boxidea").append(act);

    filllogs(res.result.log);
                    }


    
                }
    
    },'JSON');
    
    

    function goidea(){
        var idea = $("#idea").val();
        if(idea == null){
            alert("请输入高见");
            return false;
        }

    var filebox = [];
        $(".fileapp").each(function(){
	var filepath = $(this).attr("value");
	var filename = $(this).attr("name");
    filebox.push({"filename":filename,"filepath":filepath});
   });



        $.post("/api/Jg/passidea",{"id":id,"idea":idea,"files":filebox},function(res){


                if(res.result.code==200){
                    alert("提交成功");
                    location.href="exptindex2.html";
                }else{
                    alert(res.result.msg);
                }

        },'Json');
    }
    
    </script>



<script>
    $("#fileapprove").change(function(){
	        //创建FormData对象
	        var data = new FormData();
	        //为FormData对象添加数据
	        $.each($('#fileapprove')[0].files, function(i, file) {
	            data.append('upload_file'+i, file);
	        });

	       console.log(data);

	        //发送数据
        $.ajax({
	            url:HTTP_HOST+'api/Index/upload',
	            type:'POST',
	            data:data,
	            cache: false,
	            contentType: false, //不可缺参数
	            processData: false,     //不可缺参数
	            success:function(data){
	                console.log(data);
			   var res = ""; 
			$.each(data.result,function(k,v){
				res+= `<div class="add-item-files-span">`+k+`：`+v+`<span class="close" onclick="removefile(this)">X</span><input type='hidden' value=`+v+` name=`+k+` class='fileapp'>
            </div>`;	

			});
              console.log(res);
			   $("#boxfiles").append(res);

	            },
	            error:function(){
	                alert('上传出错');
	                $(".loading").hide();   //加载失败移除加载图片
	            }
	        });
	    });



    </script>

</body>
</html>